<template>
  <div>
    <el-container>
      <el-header>

<!--        左上标题-->
        <div class="BackTitle">
          <BackTitle size="55px"></BackTitle>
        </div>

<!--        右上退出-->
        <div class="exit" @click="toList">
          退出
        </div>

      </el-header>
      <el-main>

<!--        进度条-->
        <div class="progress-bar-long">
          <div class="progress-bar-short"></div>
        </div>

<!--        标题-->
        <div class="title">
          设置活动的举办时间
        </div>

<!--        日历-->
        <div class="calendar-border">
          <el-calendar v-model="month">
            <div  slot="dateCell" slot-scope="slot" @click="ModifyDate(slot)">
              {{ slot.data.day.split('-')[2] }}
            </div>
          </el-calendar>
        </div>

      </el-main>
      <el-footer>

        <div class="button">
          <el-button @click="toDetail">返回</el-button>
          <el-button @click="toDetail2">下一步</el-button>
        </div>

      </el-footer>
    </el-container>
  </div>
</template>

<script>
import BackTitle from "@/components/BackTitle";
import BackButton from "@/components/BackButton";
export default {
  components: {BackButton, BackTitle},
  data() {
    return {
      month: new Date(),
    }
  },
  methods: {
    toList() {
      this.$router.push({
        name:'List'
      })
    },
    toDetail(){
      this.$router.push({
        name:'Detail'
      })
    },
    toDetail2(){
      this.$router.push({
        name:'Detail2'
      })
    },
    ModifyDate(slot){
      let newFormatedDate = slot.data.day.split('-')[0] + '年·' + slot.data.day.split('-')[1] + '月' + slot.data.day.split('-')[2] + '日'
      this.$store.state.editedEvent.Date = newFormatedDate
    }
  },
}
</script>

<style scoped>

/*整体三层布局*/
.el-container{
  width: 100%;
  height: 100%;
  position: absolute;
}

/*左上标题*/
.BackTitle{
  /*!*方便观察分区，画出分区边界*!*/
  /*border: 1px solid red;*/

  width: 30%;

  margin-left: -4%;
  margin-top: -1%;
}

/*右上退出*/
.exit{
  /*!*方便观察分区，画出分区边界*!*/
  /*border: 1px solid red;*/

  float:right;

  margin-top: -1.3%;

  font-size: 20px;
}


.button{
  /*!*方便观察分区，画出分区边界*!*/
  /*border: 1px solid red;*/

  float: right;
  margin-right: 7%;
  margin-top: 0.5%;


}

.el-footer{
  border-top-style: solid;
  border-top-width:1px;
  border-top-color:#BBBBBB;
}
.el-button{
  background-color: #F65858;
  color: #fff;

  font-weight: 700;

  border-radius: 5px;;
  border:none;

  width:240px;
  height: 40px;
}

.progress-bar-long{
  background-color: #CECECE;

  width: 100%;
  height: 2%;
  position: absolute;
  margin-left: -1.02%;

}

.progress-bar-short{
  background-color: #008294;

  width: 40%;
  height: 100%;
  position: absolute;
}

.title{
  /*方便观察分区，画出分区边界*/
  border: 1px solid red;

  position: absolute;
  margin-top: 5%;
  margin-left: 35%;

  font-size: 50px;
  font-weight: 600;
}

.calendar-border{
  /*设定边界和阴影*/
  border: 1px solid #BBBBBB;

  /*设定整体位置和大小*/
  width: 80%;
  height: 70%;
  position: absolute;
  margin-top: 10%;
  margin-left: 10%;
}

.el-calendar {
  background-color: #fff;
  /*width:28%;*/

  /*!*height属性不影响日历中的内容*!*/
  /*height: 80%;*/

  position:absolute;
  /*margin-top: 8%;*/
}

::v-deep .el-calendar__title {
  color: #008294;
  align-self: center;
  font-size:20px;
  font-weight: 600;

}

::v-deep .el-calendar .el-calendar__body{
  /*!*方便观察分区，画出分区边界*!*/
  /*border: 1px solid red;*/

  /*!*修改高度没用，但是修改背景颜色有用*!*/
  /*height: 40%;*/
  /*background-color: #008294;*/

}

::v-deep .el-calendar-table{
  /*!*方便观察分区，画出分区边界*!*/
  /*border: 1px solid red;*/

  /*!*修改高度没用，但是修改背景颜色有用*!*/
  /*height: 40%;*/
  /*background-color: #008294;*/
}

::v-deep .el-calendar-day{
  height:4.4em;
}
</style>
